import { defineStore } from 'pinia'

export const useIsDarkStore = defineStore('isDark', () => {
    // 是否深色
    const isDark = ref(false)
    const setIsDark = (v: boolean) => {
        isDark.value = v
    }

    return {
        isDark,
        setIsDark
    }
}, {
    persist: {
        enabled: true,
        strategies: [
            {
                key: 'my-isDark', //自定义 Key值
                storage: localStorage, // 选择存储方式
            },
        ],

    },
})